package spring.superrun.record.mvc.entity;

import org.springframework.data.annotation.Id;
import spring.superrun.tool.newid.NewIdByUUId;

import java.io.Serializable;
import java.util.Date;

/**
 * (SuperrunRunrecords)实体类
 *
 * @author makejava
 * @since 2021-06-18 09:14:32
 */
public class SuperrunRunrecords implements Serializable {
    private static final long serialVersionUID = -84290062072696767L;
    public SuperrunRunrecords(){

    }
    /**
     * id
     */
    private String id;
    /**
     * 命中该点时间
     */
    private Date finishtime;
    /**
     * 距离上一个完成点的时间(单位秒)
     */
    private Integer fromlasttimesecond;
    /**
     * 地点id
     */
    private String locationid;
    /**
     * 备注
     */
    private String note;
    /**
     * 用户id
     */
    private String userid;
    /**
     * 当前点距离起始点的距离
     */
    private Double fromstartdistance;
    /**
     * 当前点距离上一个点的距离
     */
    private Double fromlastdistance;
    /**
     * 平均速度
     */
    private Double avgspeed;
    /**
     * 最快平均速度
     */
    private Double maxavgspeed;

    private SuperrunLocations location;

    public SuperrunRunrecords(Date date, String locationId
            , String userId, double fromLastDistacnce) {
        finishtime =date;
        this.locationid = locationId;
        this.userid = userId;
        this.fromlastdistance =fromLastDistacnce;
        this.fromlasttimesecond =0;
        this.fromstartdistance=0.0;
        maxavgspeed=0.0;
        avgspeed=0.0;
    }
    public void Add(){
        id = "RC"+NewIdByUUId.GetUUIDNoMinus();
    }
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getFinishtime() {
        return finishtime;
    }

    public void setFinishtime(Date finishtime) {
        this.finishtime = finishtime;
    }

    public Integer getFromlasttimesecond() {
        return fromlasttimesecond;
    }

    public void setFromlasttimesecond(Integer fromlasttimesecond) {
        this.fromlasttimesecond = fromlasttimesecond;
    }

    public String getLocationid() {
        return locationid;
    }

    public void setLocationid(String locationid) {
        this.locationid = locationid;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public Double getFromstartdistance() {
        return fromstartdistance;
    }

    public void setFromstartdistance(Double fromstartdistance) {
        this.fromstartdistance = fromstartdistance;
    }

    public Double getFromlastdistance() {
        return fromlastdistance;
    }

    public void setFromlastdistance(Double fromlastdistance) {
        this.fromlastdistance = fromlastdistance;
    }

    public Double getAvgspeed() {
        return avgspeed;
    }

    public void setAvgspeed(Double avgspeed) {
        this.avgspeed = avgspeed;
    }

    public Double getMaxavgspeed() {
        return maxavgspeed;
    }

    public void setMaxavgspeed(Double maxavgspeed) {
        this.maxavgspeed = maxavgspeed;
    }

    public SuperrunLocations getLocation() {
        return location;
    }

    public void setLocation(SuperrunLocations location) {
        this.location = location;
    }
}
